package com.agent.AiService;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

@AiService(
        wiringMode = EXPLICIT,
        streamingChatModel = "qwenStreamingChatModel", // 指定使用的流式输出大语言模型
        chatMemoryProvider = "chatMemoryProvider", // 配置会话隔离、会话记忆、持久存储
        tools = {"calendarTools","activityRecordTools", "weatherTools", "QQEmailTools","courseScheduleTools"},
        contentRetriever = "contentRetrieverPinecone"// 使用指定的RAG技术
)
public interface AgentService {

    @SystemMessage(fromResource = "Agent-Prompt.md")
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage, @V("userId") Long userId);
}

